package com.yanqu.road.entity.activity.dragonboatrace;

import com.yanqu.road.entity.DataObject;
import com.yanqu.road.entity.FieldTypeAnnotation;
import com.yanqu.road.entity.DataStatus;
import com.yanqu.road.entity.union.UnionBaseInfo;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

/**
 * @Description 赛龙舟联盟信息表
 * @Author cwq
 * @Data 2021/5/11 18:28
 */
@FieldTypeAnnotation(tableName = "t_c_activity_dragonboatrace_union_data")
public class DragonBoatRaceUnionData extends DataObject {

    @FieldTypeAnnotation(select = true, update = true, desc = "活动id")
    private int activityId;

    @FieldTypeAnnotation(select = true, update = true, desc = "商会id")
    private String unionId;

    @FieldTypeAnnotation(desc = "航行的距离(不包括今日联盟航行距离)")
    private long distance ;

    @FieldTypeAnnotation(desc = "航行记录刷新时间（s）")
    private int recordRefreshTime ;

    @FieldTypeAnnotation(desc = "每日航行记录")
    private List<DragonBoatRaceVoyageRecord> recordList = new ArrayList<>();

    /**
     * 航行记录 k：userId
     */
    private Map<Long,DragonBoatRaceVoyageRecord> recordMap = new ConcurrentHashMap<>();

    @FieldTypeAnnotation(desc = "领取信息 k:地点id v:领取人id 集合")
    private Map<Integer, List<Long>> receivedInfoMap = new ConcurrentHashMap<>();

    @FieldTypeAnnotation(desc = "成员航行信息 k:玩家id v:航行信息 集合")
    private Map<Long,DragonBoatRaceMemberRecord> memberRecordMap = new ConcurrentHashMap<>();

    @FieldTypeAnnotation(desc = "联盟信息")
    private UnionBaseInfo unionBaseInfo;

    /**
     * 今日联盟航行距离
     */
    private long todayUnionDistance;

    public int getActivityId() {
        return activityId;
    }
    public void setActivityId(int activityId) {
        if (this.activityId != activityId) {
            this.activityId = activityId;
            setOp(DataStatus.Update);
        }
    }

    public String getUnionId() {
        return unionId;
    }
    public void setUnionId(String unionId) {
        if (unionId == null){
            return;
        }
        if (this.unionId == null || !this.unionId.equals(unionId)) {
            this.unionId = unionId;
            setOp(DataStatus.Update);
        }
    }

    public long getDistance() {
        return distance;
    }
    public void setDistance(long distance) {
        if (this.distance != distance) {
            this.distance = distance;
            setOp(DataStatus.Update);
        }
    }

    public int getRecordRefreshTime() {
        return recordRefreshTime;
    }
    public void setRecordRefreshTime(int recordRefreshTime) {
        if (this.recordRefreshTime != recordRefreshTime) {
            this.recordRefreshTime = recordRefreshTime;
            setOp(DataStatus.Update);
        }
    }

    public List<DragonBoatRaceVoyageRecord> getRecordList() {
        return recordList;
    }
    public void setRecordList(List<DragonBoatRaceVoyageRecord> recordList) {
        if (null == recordList){
            return;
        }
        if (this.recordList == null || !this.recordList.equals(recordList)) {
            this.recordList = recordList;
            setOp(DataStatus.Update);
        }
    }

    public Map<Integer, List<Long>> getReceivedInfoMap() {
        return receivedInfoMap;
    }
    public void setReceivedInfoMap(Map<Integer, List<Long>> receivedInfoMap) {
        if (null == receivedInfoMap){
            return;
        }
        if (this.receivedInfoMap == null || !this.receivedInfoMap.equals(receivedInfoMap)) {
            this.receivedInfoMap = receivedInfoMap;
            setOp(DataStatus.Update);
        }
    }

    public Map<Long, DragonBoatRaceMemberRecord> getMemberRecordMap() {
        return memberRecordMap;
    }

    public void setMemberRecordMap(Map<Long, DragonBoatRaceMemberRecord> memberRecordMap) {
        if (null == memberRecordMap){
            return;
        }
        if (this.memberRecordMap == null || !this.memberRecordMap.equals(memberRecordMap)) {
            this.memberRecordMap = memberRecordMap;
            setOp(DataStatus.Update);
        }
    }

    public Map<Long, DragonBoatRaceVoyageRecord> getRecordMap() {
        return recordMap;
    }

    public void setRecordMap(Map<Long, DragonBoatRaceVoyageRecord> recordMap) {
        this.recordMap = recordMap;
    }

    public long getTodayUnionDistance() {
        return todayUnionDistance;
    }

    public void setTodayUnionDistance(long todayUnionDistance) {
        this.todayUnionDistance = todayUnionDistance;
    }

    public UnionBaseInfo getUnionBaseInfo() {
        return unionBaseInfo;
    }
    public void setUnionBaseInfo(UnionBaseInfo unionBaseInfo) {
        if (null == unionBaseInfo){
            return;
        }
        if (this.unionBaseInfo == null || !this.unionBaseInfo.equals(unionBaseInfo)) {
            this.unionBaseInfo = unionBaseInfo;
            setOp(DataStatus.Update);
        }
    }
}
